package com.example.demo.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WJ
 * Date: 2023-02-21
 * Time: 15:44
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Notice {
    private Integer id;
    private String title;
    private String context;
    // 入参时确保能识别 yyyy-MM-dd 格式的日期字符串
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    // 出参时确保是一个 yyyy-MM-dd 类型的字符串，国际标准事件与国内时间相差8小时
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date time;
    private Integer user_id;
}
